package com.zsl.swing.redis.desktop.type;

import java.util.Arrays;

public enum DbOptEnum {

    QUERY("精确查询"), LIKE("模糊查询"),DELETE_LIKE("模糊删除"),DELETE("删除"),VALUE_FORMAT_SHOW("格式化展示"),NEW_WINDOW("打开新的操作窗口"),
    UPDATE("修改"),ADD("新增"),SHOW_ALL("展示所有key"), MORE("查看更多"),SET_EXPIRE("设置过期时间"),FLUSH("清空数据库"),OPEN_CONSOLE("打开命令窗口");

    private String text;

    DbOptEnum(String text){
        this.text = text;
    }

    public static DbOptEnum locate2Enum(String actionCommand) {
        return Arrays.stream(values()).filter(one -> one.text.equals(actionCommand)).findAny().orElse(null);
    }

    public String getText(){
        return this.text;
    }
}
